package com.itheima.reggie.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.reggie.Utils.AliyunSmsUtil;
import com.itheima.reggie.entity.Dish;
import com.itheima.reggie.entity.User;
import com.itheima.reggie.mapper.DishMapper;
import com.itheima.reggie.mapper.UserMapper;
import com.itheima.reggie.service.DishService;
import com.itheima.reggie.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description:
 * @Title: UserServiceImpl
 * @Package com.itheima.reggie.service.impl
 * @Author: 🐟
 * @Copyright 🐟
 * @CreateTime: 2022/9/15 19:48
 */
@Service
@Slf4j
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Override
    public String sendmsg(String phone) {
        //生成6位数验证码
        String logincode = RandomUtil.randomNumbers(6);
        log.info(logincode);
        //AliyunSmsUtil.sendSms(phone, Integer.parseInt(logincode));
        return logincode;

    }
}
